<template>
  <div>
    <h2 class="demo">姓名：{{ name }}</h2>
    <h2>age:{{ age }}</h2>
    <button @click="sendName">点我传递名字</button>
    <button @click="removeThings">点我解绑事件</button>
  </div>
</template>

<script>
    export default {
        name:'My',
        data(){
            return {
                name:'张三',
                age:20
            }
        },
        methods:{
          sendName(){
            //触发该事件
            this.$emit('liangyu',this.name,666,888,999,1010)
          },
          removeThings(){
            //解绑事件
            this.$off('liangyu')
            //解绑多个事件
            // this.$off(['liangyu','demo'])
            //解绑所有事件
            // this.$off()
          }
        }
    }
</script>

<style scoped>
  .demo{
    color: green;
  }
</style>
